#coding:utf8

from pyspark.sql import *
import os
from pyspark.sql.types import *
import pandas as pd

if __name__ == '__main__':
    spark=SparkSession.builder.appName("test1_dataFrame_create")\
        .master("local[*]").getOrCreate()
    sc=spark.sparkContext
    localhost_path = 'file://' + os.getcwd() + '/../data/input/sql/people.csv'
    df=spark.read.format("csv").option("header",True)\
        .option("sep",';').option("encoding",'utf-8')\
        .schema("name STRING,age INT,job STRING").load(localhost_path)

    # df.printSchema()
    # df.show()

























































